package nu.aing.P20140505;

/**
 * Constraint :
 * - word will contain between 1 and 50 characters, inclusive.
 * - Each character in word will be an uppercase English letter ('A'-'Z').
 * 
 * @author memekmaut@gmail.com
 */
public class WritingWords {
    
    public static void main(String[] args) {
        WritingWords ww = new WritingWords();
        System.out.println(ww.write("A") );
        System.out.println(ww.write("ABC") );
        System.out.println(ww.write("VAMOSGIMNASIA") );
        System.out.println(ww.write("TOPCODER") );
        System.out.println(ww.write("SINGLEROUNDMATCH") );
        System.out.println(ww.write("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ") );
    }
    
    // While typing a word, Ciel has to make a short pause after typing each letter, 
    // so that the phone can tell when one letter ends and another letter begins. 
    // These pauses do not matter in this problem. 
    // A = 65
    public int write(String word) {
        int result = 0;
        for(int i = 0; i < word.length(); i++) {
            result += ( (int) word.charAt(i) - 64);
        }
        return result;
    }
}
